import matplotlib.pyplot as plt
import numpy as np

# NIQE 数据
categories = ['512', '256', '1024']
gt_values = [3.91, 4.96, 4.77]
hide_values = [4.22, 7.06, 4.74]
reverse_values = [4.59, 11.8, 4.51]

# 设置柱状图的宽度和位置
bar_width = 0.2
index = np.arange(len(categories))

# 设置背景色为白色
plt.figure(facecolor='white')

# 定义柔和的颜色
gt_color = '#6a9bdc'       # soft blue
hide_color = '#a5d080'     # soft green
reverse_color = '#ffcb9a'  # soft orange

# 绘制分组柱状图
plt.bar(index, gt_values, width=bar_width, label='GT', color=gt_color)
plt.bar(index + bar_width, hide_values, width=bar_width, label='Hide', color=hide_color)
plt.bar(index + 2 * bar_width, reverse_values, width=bar_width, label='Reverse', color=reverse_color)

# 添加标签和标题
plt.xlabel('Resolution', fontsize=12)
plt.ylabel('NIQE Score', fontsize=12)
plt.title('NIQE Scores at Different Resolutions', fontsize=14)
plt.xticks(index + bar_width, categories)  # 设置 x 轴刻度
plt.legend()  # 显示图例

# 显示图形
plt.tight_layout()
plt.savefig("save/resolution.png")